package com.greenline.push.core.pushcenter.impl;

import org.springframework.beans.factory.annotation.Autowired;

import com.greenline.push.core.pushcenter.ClassDefineManager;
import com.greenline.push.dal.pushcenter.ClassDefineDAO;
import com.greenline.push.dal.pushcenter.dataobject.ClassDefineDO;
import com.greenline.push.dal.query.ClassDefineQuery;

public class ClassDefineManagerImpl implements ClassDefineManager {

	@Autowired
	private ClassDefineDAO classDAO;

	@Override
	public Long insert(ClassDefineDO classDefineDO) {
		return classDAO.insert(classDefineDO);
	}

	@Override
	public ClassDefineDO getClassDefineById(Long id) {
		return classDAO.getClassDefineById(id);
	}

	@Override
	public boolean update(ClassDefineDO classDefineDO) {
		return classDAO.update(classDefineDO) > 0;
	}

	@Override
	public ClassDefineQuery listByQuery(ClassDefineQuery query) {
		return classDAO.listByQuery(query);
	}

	@Override
	public boolean delete(Long id) {
		return classDAO.delete(id) > 0;
	}

	@Override
	public ClassDefineDO getClassDefineByName(String name) {
		return classDAO.getClassDefineByName(name);
	}

    @Override
    public ClassDefineDO getByCode(String code) {
        return classDAO.getClassDefineByCode(code);
    }

}
